<?php
class GeoLocation
{
    public static function locate($ip)
    {
         $adapter = Zend_Registry::get('dbAdapter');
         $ip = $adapter->quote($ip);
         $row = $adapter->fetchRow("SELECT * FROM geo_light  WHERE 
indexgeo = INET_ATON($ip)-(INET_ATON($ip)%65536) AND
INET_ATON($ip) BETWEEN startip AND endip LIMIT 10;");
         
         return $row;
    }
}